package com.hmkj.admin.controller.operate;

import com.hmkj.admin.controller.BaseController;
import com.hmkj.core.po.operate.Agent;
import com.hmkj.core.po.system.Admin;
import com.hmkj.core.service.operate.AgentService;
import com.hmkj.core.service.system.AdminService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

/**
 * 代理商
 */
@Controller
@RequestMapping(BaseController.BASE_URI)
public class AgentController extends BaseController {
    @Resource
    private AgentService agentService;


    @RequestMapping("/agent/list")
    public String list() {
        return ok("operate/agent/list");
    }


    /**
     * 代理商详情
     */
    @RequestMapping(value = "/agent/detail")
    public String detail(Integer agentId, ModelMap modelMap) throws Exception {
       Agent agent  = agentService.selectByPrimaryKey(agentId);
        modelMap.put("agent", agent);
        return getAdminTemplate("operate/agent/detail");
    }
}
